package com.ys.controller;

import com.github.pagehelper.PageHelper;
import com.ys.service.DrugsService;
import com.ys.service.DrugssService;
import com.ys.vo.PageVo;
import com.ys.vo.ResultVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;

@Controller
public class SellController {
    @Resource
    private DrugsService drugsService;

    @RequestMapping("/spxs/xiaoshou")
    public String xiaoShou(){
        return "/spxs/xiaoshou";
    }

    @RequestMapping("/spxs/selecct")
    @ResponseBody
    public ResultVo selecct(String id,String name1,String pageNo,String pageSize,String name2
    ,String name3,String name4){
        ResultVo resultVo = new ResultVo();
        PageHelper.startPage(Integer.parseInt(pageNo),Integer.parseInt(pageSize));
        resultVo.setObj(new PageVo(drugsService.select(id,name1,name2,name3,name4)));
        return resultVo;
    }
}
